﻿using System;
using VIT.Business;

namespace VIT.Web
{
    public partial class NewsPicDetail : VIT.Web.UI.VITComponent
    {
        public BLArticle bla;
        public BLCategory blc;
        int vId;
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (!IsPostBack)
            //{
                try
                {
                    vId = int.Parse(Request["sId"]);
                    bla = new BLArticle();
                    bla.Id = vId;
                    bla.LanguageId = Session["Language"].ToString();
                    bla.GetSingle();
                    if (bla.Id > 0)
                    {
                        //load tieu de nhom
                        blc = new BLCategory();
                        blc.LanguageId = bla.LanguageId;
                        blc.Id = bla.CategoryId;
                        blc.GetSingle();
                    }
                }
                catch
                {
                    RedirectComponent("Home");
                }
            //}
        }
        protected void Pager_PreRender(object sender, EventArgs e)
        {
            //tin khac
            if (bla != null)
            {
                ListView.DataSource = bla.GetNewsOrther(5, vId, bla.CategoryId, "SharingHappiness");
                ListView.DataBind();
            }
        }
    }
}
